package com.topisv.tms.service.stock.tempStock;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.topisv.tms.entity.stock.tempStock.WarehouseTempStock;
import com.topisv.tms.repository.stock.tempStock.WarehouseTempStockDao;
import com.topisv.tms.service.base.BaseService;

/**
 * 临时库存_service
 * @author ghs
 *
 */
@Component
@Transactional(readOnly = true)
public class WarehouseTempStockService extends BaseService{
	@Autowired
	private WarehouseTempStockDao warehouseTempStockDao;
	
	public void saveMoveStockBill(WarehouseTempStock msb){
		warehouseTempStockDao.save(msb);
	}
	
	public void tempDeductionStockById(Long tempStockId,String sku,String isSale,String skuNum){
		WarehouseTempStock wts = warehouseTempStockDao.findOne(tempStockId);
		tempDeductionStock(wts, sku, isSale, skuNum);
	}
	
	public void tempDeductionStockByRefBillCode(String refBillCode,String sku,String isSale,String skuNum){
		WarehouseTempStock wts = warehouseTempStockDao.findByRefBillCode(refBillCode);
		tempDeductionStock(wts, sku, isSale, skuNum);
	}
	
	public void tempDeductionStock(WarehouseTempStock wts,String sku,String isSale,String skuNum){
		
	}
	
}
